package com.raptor.trustworthy.server.contraller;

import com.raptor.trustworthy.server.service.Gogogo;
import com.raptor.trustworthypojo.pojo.TCooker;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author renhuan
 * @Date 2020-08-31 17:17
 **/
@RestController
@RequestMapping("/gogogo")
public class GogogoContraller {

  @Autowired
  public Gogogo gogogo;

  @PostMapping("/goTrue")
  public void goTrue(){
    gogogo.goTrue();
  }

  @PostMapping("/setErrorList")
  public String setErrorList(){
    return gogogo.setErrorList();
  }

  @PostMapping("/getErrorList")
  public String getErrorList(){
    return gogogo.getErrorList();
  }

  @GetMapping("/test")
  public void gotest(){
     gogogo.goTest();
  }

  @GetMapping("/getAllCook")
  public List<TCooker> getAllCook(){
    return gogogo.getAllCook();
  }

  @GetMapping("/queryAllCookByCookerId")
  public List<TCooker> queryAllCookByCookerId(@Param("cookerId") Long cookerId){
    return gogogo.queryAllCookByCookerId(cookerId);
  }





}
